/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;

namespace DaveSexton.DocProject.Sandcastle.Configuration
{
	public sealed class ProjectPathsElement : ConfigurationElement
	{
		#region Public Properties
		[ConfigurationProperty("root", DefaultValue = @"Help\", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string RelativeHelpRoot
		{
			get
			{
				return base["root"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["root"] = value;
			}
		}

		[ConfigurationProperty("presentation", DefaultValue = @"Presentation\Style", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string Presentation
		{
			get
			{
				return base["presentation"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["presentation"] = value;
			}
		}

		[ConfigurationProperty("sharedPresentation", DefaultValue = @"Presentation\Shared", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string SharedPresentation
		{
			get
			{
				return base["sharedPresentation"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["sharedPresentation"] = value;
			}
		}

		[ConfigurationProperty("presentationConfig", DefaultValue = @"Presentation\Style\Configuration", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string Configuration
		{
			get
			{
				return base["presentationConfig"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["presentationConfig"] = value;
			}
		}

		[ConfigurationProperty("presentationTransforms", DefaultValue = @"Presentation\Style\Transforms", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string Transforms
		{
			get
			{
				return base["presentationTransforms"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["presentationTransforms"] = value;
			}
		}

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x")]
		[ConfigurationProperty("help1xConfigFileName", DefaultValue = "sandcastle.help1x.config", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string Help1xConfigFileName
		{
			get
			{
				return base["help1xConfigFileName"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["help1xConfigFileName"] = value;
			}
		}

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x")]
		[ConfigurationProperty("help2xConfigFileName", DefaultValue = "sandcastle.help2x.config", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string Help2xConfigFileName
		{
			get
			{
				return base["help2xConfigFileName"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["help2xConfigFileName"] = value;
			}
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x")]
		[ConfigurationProperty("help1xConceptualConfigFileName", DefaultValue = "conceptual.help1x.config", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string Help1xConceptualConfigFileName
		{
			get
			{
				return base["help1xConceptualConfigFileName"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["help1xConceptualConfigFileName"] = value;
			}
		}

		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "x")]
		[ConfigurationProperty("help2xConceptualConfigFileName", DefaultValue = "conceptual.help2x.config", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string Help2xConceptualConfigFileName
		{
			get
			{
				return base["help2xConceptualConfigFileName"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["help2xConceptualConfigFileName"] = value;
			}
		}

		[ConfigurationProperty("comments", DefaultValue = @"Comments\", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string RelativeCommentsPath
		{
			get
			{
				return base["comments"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["comments"] = value;
			}
		}

		/// <summary>
		/// Gets or sets the relative path to user-defined topic files, based from the <see cref="RelativeHelpRoot"/> path.
		/// </summary>
		/// <remarks>
		/// With the default values of this property and the <see cref="RelativeHelpRoot"/> properties applied, the relative path to
		/// user topic files is <strong>Help\Topics\</strong>, based at the project's root.
		/// </remarks>
		[ConfigurationProperty("topics", DefaultValue = @"Topics\", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string RelativeTopicsPath
		{
			get
			{
				return base["topics"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["topics"] = value;
			}
		}

		[ConfigurationProperty("settings", DefaultValue = @"Settings\", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string RelativeSettingsPath
		{
			get
			{
				return base["settings"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["settings"] = value;
			}
		}

		[ConfigurationProperty("schemas", DefaultValue = @"Schemas\", IsRequired = false)]
		[StringValidator(MinLength = 1)]
		public string RelativeSchemasPath
		{
			get
			{
				return base["schemas"] as string;
			}
			set
			{
				if (value == null)
					throw new ArgumentNullException("value");

				base["schemas"] = value;
			}
		}
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="ProjectPathsElement" /> class.
		/// </summary>
		public ProjectPathsElement()
		{
		}
		#endregion
	}
}
